package com.service.kind;

import com.dao.kind.KindDaoImpl;
import com.enitiy.Kind;

import java.sql.SQLException;
import java.util.List;

/**
 * 创建作者 ：MySunshine
 * 创建时间 2022/10/24 16:46
 * 项目名称 SHUSHAN
 */
public class KindServiceImpl implements KindService {
    KindDaoImpl kdi = new KindDaoImpl();
    @Override //小说类型查询
    public List<Kind> kindSelectAll() {
        List<Kind> kinds = null;
        try {
            kinds = kdi.kindSelectAll();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return  kinds;
    }

    @Override   //根据编号改名字
    public boolean kindUpdateKindById(int kid, String kind) {
        boolean b = false;
        try {
            b = kdi.kindUpdateKindById(kid, kind);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return b;
    }

    @Override     //添加新类型
    public boolean kindAdd(String kind) {
        boolean b = false;
        try {
            b = kdi.kindAdd(kind);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return b;
    }
}
